package com;

import com.bobo.job.ImageJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.util.Date;

@EnableScheduling
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class SuperApplication extends SpringBootServletInitializer {

    private static Logger logger = LoggerFactory.getLogger(SuperApplication.class);

    public static void main(String[] args) {
        SpringApplication.run(SuperApplication.class, args);
        logger.info(ImageJob.format.format(new Date()) + "[Start grabbing beautiful pictures,Execute every 5 seconds...]");
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(SuperApplication.class);
    }

}
